package com.spring4a.stereo_autoconfig.soundsystem;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by Temp on 2017/9/18.
 */
@Component
public class CDPlayer implements MediaPlayer {
    //自动注入接口实现类，只有一个实现类时，可以注入接口
    @Autowired
    private SgtPappers1 sgtPappers1;

    public CDPlayer() {
    }

//    public CDPlayer(CompactDisc cd) {
//        this.cd = cd;
//    }

    public void play() {
        sgtPappers1.play();
    }
}
